home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr50 / dv0599.zip / DV0599.TXT
Text File  |  1993-06-20  |  6KB  |  110 lines

  1. ======================================================================
  2.     Microsoft Product Support Services Application Note (Text File)
  3.           DV0599: COMPILING AND LINKING QUESTIONS AND ANSWERS
  4. ======================================================================
  5.                                                    Revision Date: 8/92
  6.                                                       No Disk Included
  7.  
  8. The following information applies to Microsoft Visual Basic for MS-DOS
  9. version 1.0.
  10.  
  11.  --------------------------------------------------------------------
  12. | INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
  13. | ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
  14. | Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
  15. | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
  16. | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
  17. | PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
  18. | accuracy and the use of this Application Note. This Application    |
  19. | Note may be copied and distributed subject to the following        |
  20. | conditions: 1) All text must be copied without modification and    |
  21. | all pages must be included; 2) If software is included, all files  |
  22. | on the disk(s) must be copied without modification [the MS-DOS(R)  |
  23. | utility DISKCOPY is appropriate for this purpose]; 3) All          |
  24. | components of this Application Note must be distributed together;  |
  25. | and 4) This Application Note may not be distributed for profit.    |
  26. |                                                                    |
  27. | Copyright 1992 Microsoft Corporation. All Rights Reserved.         |
  28. | Microsoft and MS-DOS are registered trademarks and Visual Basic    |
  29. | and Windows are trademarks of Microsoft Corporation.               |
  30.  --------------------------------------------------------------------
  31.  
  32. 1. Q. How do I modify a Quick library?
  33.  
  34.    A. It is not possible to modify an existing Quick library. To add
  35.       routines to a Quick library, you must re-create it. For more
  36.       information on how to create a Quick library, please refer to
  37.       Chapter 19 of the "Programmer's Guide."
  38.   
  39. 2. Q. LINK.EXE (the linker) continues to generate the error
  40.       message "R6907 DOSX16: not enough memory on exec." What is
  41.       causing this error?
  42.  
  43.    A. LINK.EXE version 5.31.009, which is provided with Microsoft
  44.       Visual Basic for MS-DOS, tries to use expanded and extended
  45.       memory by default. If either type of memory is low, that is, less
  46.       than 200K is available, it is possible that the linker can fail
  47.       and generate the error message "R6907 DOSX16: not enough memory
  48.       on exec."
  49.  
  50.       To work around this error, use the /r switch as the first option
  51.       on the link line; /r must immediately follow "LINK" for this
  52.       switch to be effective. The Visual Basic for MS-DOS (VBDOS)
  53.       environment, VBDOS.EXE, checks for this condition and adds /r to
  54.       the link line for you. This forces the linker to ignore expanded
  55.       and extended memory and run in conventional memory only.
  56.      
  57.       To work around this problem without using the /r switch, you must
  58.       make more expanded and/or extended memory available to the
  59.       linker. This may involve changing the settings for your expanded
  60.       memory manager. If you are running Visual Basic in an MS-DOS
  61.       session within Microsoft Windows, you must change the PIF
  62.       settings for that MS-DOS session.
  63.  
  64. 3. Q. My program runs in the Microsoft Visual Basic for MS-DOS
  65.       (VBDOS) environment; however, when the program is compiled, an
  66.       "out of memory" message is generated. How can I correct this
  67.       problem?
  68.  
  69.    A. If a program runs successfully in the VBDOS environment but runs
  70.       out of memory at compile time or run time, there may be a problem
  71.       with arrays. In the VBDOS environment, arrays are dynamic by
  72.       default. This means that the arrays are created at run time and
  73.       are stored in far memory. In a compiled application, arrays are
  74.       static by default. This means the arrays are created at compile
  75.       time and are stored in near memory (DGROUP), of which there is
  76.       only 64K.
  77.      
  78.       To make all your arrays dynamic in a compiled application, use
  79.       the metacommand REM $DYNAMIC at the beginning of your program
  80.       before the dimension (DIM) statements of your arrays. If you have
  81.       any arrays that are included in COMMON SHARED statements, the DIM
  82.       statements in which they are included.
  83.      
  84.       For more information on the $DYNAMIC command, please refer to the
  85.       "A-Z Reference" in the "Reference" manual.
  86.      
  87.       For more information on memory management, please refer to
  88.       Appendix B of the "Programmer's Guide."
  89.  
  90. 4. Q. When I try to compile my program, I receive a "program
  91.       memory overflow" error message. How can I correct this problem?
  92.  
  93.    A. If a program runs successfully in the Visual Basic for MS-DOS
  94.       (VBDOS) environment but generates a "program memory overflow"
  95.       error message at compile time, the program needs to be broken
  96.       down into multiple modules.
  97.      
  98.       In the VBDOS environment, each subroutine, function, event, or
  99.       module-level code is allocated 64K for code. In a compiled
  100.       application, the entire file is allocated only 64K. This
  101.       difference allows a much larger code module or form to run in the
  102.       environment than can run in a compiled application.
  103.      
  104.       To make your compiled programs run, you must reduce them in size
  105.       by moving some code to another module. For more information on
  106.       multiple-module programming, please refer to Chapters 6 and 16 of
  107.       the "Programmer's Guide."
  108.  
  109.  
  110.